<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>适配</title>
    <script>
        let width = document.documentElement.clientWidth;
        let html = document.querySelector('html');
        html.style.fontSize = width / 20 + 'px';
        window.onresize = function () {
            let width = document.documentElement.clientWidth;
            let html = document.querySelector('html');
            html.style.fontSize = width / 20 + 'px';
        }
    </script>
    <style>
        body {
            margin: 0;
        }

        .outer {
            width: 20rem /* 414/20.7 */;
            height: 10rem;
            box-sizing: border-box;
            padding: 2rem;
            background-color: pink;
        }
    </style>
</head>

<body>
    <div class="outer">
        111111
    </div>
</body>

</html>